package main

import (
	"fmt"
	"io/ioutil"
)

type Page struct {
	Title string
	Body  []byte
}

func (p *Page) save() {
	ioutil.WriteFile(p.Title, p.Body, 0666)
}

func load(title string) {
	body, _ := ioutil.ReadFile(title)
	fmt.Println(string(body))
}

func main() {
	body, _ := ioutil.ReadFile("input.dat")
	page := &Page{"text1.txt", body}
	page.save()
	load(page.Title)
}
